// 过滤空字段。otherValue：其他字段不可为对应值，如：{name: ['a','b']}
export const var_delNull = (obj, otherValue = {isStop: [-1, '']},isNew=true) => {
  if (isNew){
    obj = window.$newObj(obj)
  }
  for (let key in obj) {
    // 判断为空时，才进行删除
    if (obj[key] == undefined || (typeof obj[key] == "string" && obj[key].length <= 0)) {
      delete obj[key]
    }
    // 不为空时，判断是否包含指定值
    else {
      if (otherValue && typeof otherValue == 'object') {
        if (otherValue[key]?.includes(obj[key])) {
          delete obj[key]
        }
      }
    }
  }
  return obj
}


// 默认的翻页
export const var_search_page = (otherSearch = {}) => {
  const result = {
    pageSize: 20,
    pageNum: 1,
    total: 0,
  }
  return Object.assign(result, otherSearch)
}